<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计数器</title>
</head>
<body>
    <h1>计数器</h1>
    <p>当前值: <span id="counterValue">5</span></p>
    <button id="increase">增加</button>
    <button id="decrease">减少</button>

    <script>
        let counter = 5;

        document.getElementById('increase').addEventListener('click', function() {
            counter++;
            document.getElementById('counterValue').textContent = counter;
        });

        document.getElementById('decrease').addEventListener('click', function() {
            counter--;
            document.getElementById('counterValue').textContent = counter;
        });
    </script>
</body>
</html>
